package gui;

import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;

import javax.swing.JFrame;

import statics.Constants;

public class ControlFrame extends JFrame implements WindowListener{
	
	private Container cp;
	
	public ControlFrame(){
		super("RotationTest v"+Constants.version);
		setVisible(true);
		setDefaultCloseOperation(EXIT_ON_CLOSE);
		setPreferredSize(new Dimension(800,600));
		this.cp = getContentPane();
		cp.setLayout(null);
		
		PlayPanel p = new PlayPanel();
			p.setBounds(0,0,800,600);
			
		addKeyListener(p);
		cp.add(p);
		pack();
	}

	@Override
	public void windowActivated(WindowEvent arg0) {}

	@Override
	public void windowClosed(WindowEvent arg0) {}

	@Override
	public void windowClosing(WindowEvent arg0) {
		// TODO Implementeren = Saven + afsluiten
		System.exit(0);
	}

	@Override
	public void windowDeactivated(WindowEvent arg0) {}

	@Override
	public void windowDeiconified(WindowEvent arg0) {}

	@Override
	public void windowIconified(WindowEvent arg0) {}

	@Override
	public void windowOpened(WindowEvent arg0) {}
}
